<template>
  <div>
    <div>
      <van-cell
        v-for="so in sos"
        :key="so.id"
        :title="`${so.partner_id__name}  ${so.date_order}`"
        :label="
          `¥${so.amount_total} ${so.name} ${so.state2_name} ${
            so.purchase_order_id
          }`
        "
        is-link
        :to="{ path: '/so/register', query: { id: so.id } }"
      />
      <!-- <van-cell title="重置密码" is-link to="/user/resetpsw" /> -->
    </div>
  </div>
</template>

<script>
export default {
  name: 'SoList',
  components: {},
  directives: {},
  filters: {},
  // mixins: [],
  props: {},

  data() {
    return {}
  },
  computed: {
    sos: function() {
      return this.$store.state.SaleOrder.dataList
    },

    user: function() {
      return this.$store.state.user
    }
  },
  async created() {
    console.log('user,', this.user)
    const user = this.user
    if (user.isEmployee) {
      await this.$store.dispatch('SaleOrder/search', {
        domain: {
          analytic_account_partner_id: user.partner_id
        }
      })
      console.log('sos,', this.sos)
    }
  },

  methods: {
    handleChangePsw() {
      console.log('xxx, click handleChangePsw,')
    },
    handleAbout() {
      console.log('xxx, click  about,')
    }
  }
}
</script>

<style type="text/css"></style>
